Version Vectors
Version Vectors
is a pattern used in Distributed Models/Systems to assert if some operation has any causality/ordering OR if it's concurrent.
By keeping a counter of operations in each node, and updating them whenever nodes communicate, we can use their counter values to check if operations are concurrent (a = b) OR they have some causality. (a > b).
The same way as Lamport Timestamps, we use the max values of the peers whenever synchronizing.
Implementation
Keep an Vector of integers for each process. Increment them at each operation.
Compare the values to check if they are either concurrent (equal) or have any causality (by checking dominance - less than
or greater than
)
#versionvectors #vectors #version #distributedsystems
Comparing with Lamport Timestamps
The key differences are that Version Vectors implement arrays/vectors of integers, to track multiple concurrent things happening where as Lamport Timestamps are global and ensure a total ordering of events. Lamport cannot track concurrency since they are global values and is much more simpler than Version Vectors to implement. Complexity-wise Version Vectors are in disavantage as they need to track N processes (integers) and Lamport Timestamps are unique/global per node.